﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TeamBuy.AccessWebUI.Account
{
    public partial class MyInvites : System.Web.UI.Page
    {
        //public static string query;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["Show"] != null && Request.QueryString["Show"] != "")
            {
                if (Convert.ToString(Request.QueryString["Show"]) == "All")
                {
                    ltlAllStyle.Text = "class='current'";
                    ltlNotPaiedStyle.Text = "";
                    ltlPaiedStyle.Text = "";
                    adsInvites.SelectCommand = "SELECT * FROM [vw_UserInvites] WHERE InvitedUserID = " + Session["UserID"] + " AND IsActived=Yes";

                }
                else if (Convert.ToString(Request.QueryString["Show"]) == "NotPaied")
                {
                    ltlAllStyle.Text = "";
                    ltlNotPaiedStyle.Text = "class='current'";
                    ltlPaiedStyle.Text = "";
                    adsInvites.SelectCommand = "SELECT * FROM [vw_UserInvites] WHERE InvitedUserID = " + Session["UserID"] + " AND IsActived=Yes AND IsUserPaied=No";

                }
                else if (Convert.ToString(Request.QueryString["Show"]) == "Paied")
                {
                    ltlAllStyle.Text = "";
                    ltlNotPaiedStyle.Text = "";
                    ltlPaiedStyle.Text = "class='current'";
                    adsInvites.SelectCommand = "SELECT * FROM [vw_UserInvites] WHERE InvitedUserID = " + Session["UserID"] + " AND IsActived=Yes AND IsUserPaied=Yes";
                }
                else
                {
                    ltlAllStyle.Text = "class='current'";
                    ltlNotPaiedStyle.Text = "";
                    ltlPaiedStyle.Text = "";
                    adsInvites.SelectCommand = "SELECT * FROM [vw_UserInvites] WHERE InvitedUserID = " + Session["UserID"] + " AND IsActived=Yes";
                }
            }
            else
            {
                ltlAllStyle.Text = "class='current'";
                ltlNotPaiedStyle.Text = "";
                ltlPaiedStyle.Text = "";
                adsInvites.SelectCommand = "SELECT * FROM [vw_UserInvites] WHERE InvitedUserID = " + Session["UserID"] + " AND IsActived=Yes";
            }
        }
        protected void lbtnAll_Click(object sender, EventArgs e)
        {
            Response.Redirect("MyInvites.aspx?Show=All");
            //ltlAllStyle.Text = "class='current'";
            //ltlNotPaiedStyle.Text = "";
            //ltlPaiedStyle.Text = "";
            //adsInvites.SelectCommand = "SELECT * FROM [vw_UserInvites] WHERE InvitedUserID = " + Session["UserID"] + " AND IsActived=Yes";
            //query = adsInvites.SelectCommand;
        }

        protected void lbtnNotPaied_Click(object sender, EventArgs e)
        {
            Response.Redirect("MyInvites.aspx?Show=NotPaied");
            //ltlAllStyle.Text = "";
            //ltlNotPaiedStyle.Text = "class='current'";
            //ltlPaiedStyle.Text = "";
            //adsInvites.SelectCommand = "SELECT * FROM [vw_UserInvites] WHERE InvitedUserID = " + Session["UserID"] + " AND IsActived=Yes AND IsUserPaied=No";
            //query = adsInvites.SelectCommand;
        }

        protected void lbtnPaied_Click(object sender, EventArgs e)
        {
            Response.Redirect("MyInvites.aspx?Show=Paied");
            //ltlAllStyle.Text = "";
            //ltlNotPaiedStyle.Text = "";
            //ltlPaiedStyle.Text = "class='current'";
            //adsInvites.SelectCommand = "SELECT * FROM [vw_UserInvites] WHERE InvitedUserID = " + Session["UserID"] + " AND IsActived=Yes AND IsUserPaied=Yes";
            //query = adsInvites.SelectCommand;
        }
    }
}